* @GDK_WA_Y: Honor the Y coordinate field
* @GDK_WA_CURSOR: Honor the cursor field
* @GDK_WA_VISUAL: Honor the visual field
- * @GDK_WA_WMCLASS: Honor the wmclass_class and wmclass_name fields
* @GDK_WA_NOREDIR: Honor the override_redirect field
* @GDK_WA_TYPE_HINT: Honor the type_hint field
*
GDK_WA_Y = 1 << 3,
GDK_WA_CURSOR = 1 << 4,
GDK_WA_VISUAL = 1 << 5,
- GDK_WA_WMCLASS = 1 << 6,
- GDK_WA_NOREDIR = 1 << 7,
- GDK_WA_TYPE_HINT = 1 << 8
+ GDK_WA_NOREDIR = 1 << 6,
+ GDK_WA_TYPE_HINT = 1 << 7
} GdkWindowAttributesType;
/* Size restriction enumeration.
* @visual: #GdkVisual for window
* @window_type: type of window
* @cursor: cursor for the window (see gdk_window_set_cursor())
- * @wmclass_name: don’t use (see gtk_window_set_wmclass())
- * @wmclass_class: don’t use (see gtk_window_set_wmclass())
* @override_redirect: %TRUE to bypass the window manager
* @type_hint: a hint of the function of the window
*
GdkVisual *visual;
GdkWindowType window_type;
GdkCursor *cursor;
- gchar *wmclass_name;
- gchar *wmclass_class;
gboolean override_redirect;
GdkWindowTypeHint type_hint;
};
remaining_mask &= ~GDK_WA_NOREDIR;
}
- if ((remaining_mask & ~(GDK_WA_WMCLASS|GDK_WA_VISUAL|GDK_WA_CURSOR|GDK_WA_TITLE|GDK_WA_TYPE_HINT)) != 0)
+ if ((remaining_mask & ~(GDK_WA_VISUAL|GDK_WA_CURSOR|GDK_WA_TITLE|GDK_WA_TYPE_HINT)) != 0)
g_warning ("_gdk_window_impl_new: uexpected attribute 0x%X",
- remaining_mask & ~(GDK_WA_WMCLASS|GDK_WA_VISUAL|GDK_WA_CURSOR|GDK_WA_TITLE|GDK_WA_TYPE_HINT));
+ remaining_mask & ~(GDK_WA_VISUAL|GDK_WA_CURSOR|GDK_WA_TITLE|GDK_WA_TYPE_HINT));
hparent = GDK_WINDOW_HWND (real_parent);
impl->layered = FALSE;
impl->layered_opacity = 1.0;
- /* wclass is not any longer set always, but if is ... */
- if ((attributes_mask & GDK_WA_WMCLASS) == GDK_WA_WMCLASS)
- g_assert ((attributes->wclass == GDK_INPUT_OUTPUT) == !window->input_only);
-
if (!window->input_only)
{
dwExStyle = 0;
gdk_window_set_title (window, title);
- if (attributes_mask & GDK_WA_WMCLASS)
- {
- class_hint = XAllocClassHint ();
- class_hint->res_name = attributes->wmclass_name;
- class_hint->res_class = attributes->wmclass_class;
- XSetClassHint (xdisplay, impl->xid, class_hint);
- XFree (class_hint);
- }
+ class_hint = XAllocClassHint ();
+ class_hint->res_name = (char *) g_get_prgname ();
+ class_hint->res_class = (char *) gdk_get_program_class ();
+ XSetClassHint (xdisplay, impl->xid, class_hint);
+ XFree (class_hint);
setup_toplevel_window (window, window->parent);
break;
GdkWindow *gdk_window;
GdkWindowAttr attributes;
const gchar *title;
- gchar *wmclass_name, *wmclass_class;
gint attributes_mask;
GdkScreen *screen;
g_warning ("GtkPlug only works under X11");
title = gtk_window_get_title (window);
- _gtk_window_get_wmclass (window, &wmclass_name, &wmclass_class);
gtk_widget_get_allocation (widget, &allocation);
attributes.window_type = GDK_WINDOW_CHILD; /* XXX GDK_WINDOW_PLUG ? */
attributes.title = (gchar *) title;
- attributes.wmclass_name = wmclass_name;
- attributes.wmclass_class = wmclass_class;
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes_mask = GDK_WA_VISUAL;
attributes_mask |= (title ? GDK_WA_TITLE : 0);
- attributes_mask |= (wmclass_name ? GDK_WA_WMCLASS : 0);
if (gtk_widget_is_toplevel (widget))
{
attributes.window_type = GDK_WINDOW_CHILD;
attributes.title = (gchar *) gtk_window_get_title (window);
- _gtk_window_get_wmclass (window, &attributes.wmclass_name, &attributes.wmclass_class);
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes_mask = GDK_WA_VISUAL;
attributes_mask |= (attributes.title ? GDK_WA_TITLE : 0);
- attributes_mask |= (attributes.wmclass_name ? GDK_WA_WMCLASS : 0);
gdk_window = gdk_window_new (embed_widget->parent_window,
&attributes, attributes_mask);
gchar *startup_id;
gchar *title;
- gchar *wmclass_class;
- gchar *wmclass_name;
gchar *wm_role;
guint keys_changed_handler;
gtk_container_set_default_resize_mode (GTK_CONTAINER (window), GTK_RESIZE_QUEUE);
priv->title = NULL;
- priv->wmclass_name = g_strdup (g_get_prgname ());
- priv->wmclass_class = g_strdup (gdk_get_program_class ());
priv->wm_role = NULL;
priv->geometry_info = NULL;
priv->type = GTK_WINDOW_TOPLEVEL;
return window->priv->title;
}
-/**
- * gtk_window_set_wmclass:
- * @window: a #GtkWindow
- * @wmclass_name: window name hint
- * @wmclass_class: window class hint
- *
- * Don’t use this function. It sets the X Window System “class” and
- * “name” hints for a window. According to the ICCCM, you should
- * always set these to the same value for all windows in an
- * application, and GTK+ sets them to that value by default, so calling
- * this function is sort of pointless. However, you may want to call
- * gtk_window_set_role() on each window in your application, for the
- * benefit of the session manager. Setting the role allows the window
- * manager to restore window positions when loading a saved session.
- *
- **/
-void
-gtk_window_set_wmclass (GtkWindow *window,
- const gchar *wmclass_name,
- const gchar *wmclass_class)
-{
- GtkWindowPrivate *priv;
-
- g_return_if_fail (GTK_IS_WINDOW (window));
-
- priv = window->priv;
-
- g_free (priv->wmclass_name);
- priv->wmclass_name = g_strdup (wmclass_name);
-
- g_free (priv->wmclass_class);
- priv->wmclass_class = g_strdup (wmclass_class);
-
- if (_gtk_widget_get_realized (GTK_WIDGET (window)))
- g_warning ("gtk_window_set_wmclass: shouldn't set wmclass after window is realized!");
-}
-
/**
* gtk_window_set_role:
* @window: a #GtkWindow
GtkMnemonicHash *mnemonic_hash;
g_free (priv->title);
- g_free (priv->wmclass_name);
- g_free (priv->wmclass_class);
g_free (priv->wm_role);
gtk_window_release_application (window);
#endif
attributes.title = priv->title;
- attributes.wmclass_name = priv->wmclass_name;
- attributes.wmclass_class = priv->wmclass_class;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes_mask |= GDK_WA_VISUAL | GDK_WA_TYPE_HINT;
attributes_mask |= (priv->title ? GDK_WA_TITLE : 0);
- attributes_mask |= (priv->wmclass_name ? GDK_WA_WMCLASS : 0);
gdk_window = gdk_window_new (parent_window, &attributes, attributes_mask);
}
}
}
-void
-_gtk_window_get_wmclass (GtkWindow *window,
- gchar **wmclass_name,
- gchar **wmclass_class)
-{
- GtkWindowPrivate *priv = window->priv;
-
- *wmclass_name = priv->wmclass_name;
- *wmclass_class = priv->wmclass_class;
-}
-
/**
* gtk_window_set_has_user_ref_count:
* @window: a #GtkWindow
GDK_AVAILABLE_IN_ALL
const gchar * gtk_window_get_title (GtkWindow *window);
GDK_AVAILABLE_IN_ALL
-void gtk_window_set_wmclass (GtkWindow *window,
- const gchar *wmclass_name,
- const gchar *wmclass_class);
-GDK_AVAILABLE_IN_ALL
void gtk_window_set_role (GtkWindow *window,
const gchar *role);
GDK_AVAILABLE_IN_ALL
void _gtk_window_set_is_toplevel (GtkWindow *window,
gboolean is_toplevel);
-void _gtk_window_get_wmclass (GtkWindow *window,
- gchar **wmclass_name,
- gchar **wmclass_class);
-
void _gtk_window_set_allocation (GtkWindow *window,
const GtkAllocation *allocation,
GtkAllocation *allocation_out);